import { createRouter, createWebHistory } from "vue-router";
//登录
import Userlogin from "../view/Login/userlogin.vue";
import Superadmin from "../view/Login/superadmin.vue";
import Adminlogin from "../view/Login/adminlogin.vue";
//首页
import Adminhome from "../view/Home/adminhome.vue";
import SuperHome from "../view/Home/superHome.vue";
import UserHome from "../view/Home/userHome.vue";
// -----用户
import Borrow from "../view/User/borrow.vue";
import Message from "../view/User/message.vue";
import News from "../view/User/news.vue";
import Peccant from "../view/User/peccant.vue";
import Rule from "../view/User/rule.vue";
import Search from "../view/User/search.vue";
import Intelligent from "../view/User/intelligent.vue";
import Comment from "../view/User/comment.vue";
import First from "../view/User/first.vue";
//管理员
import ABorrow from "../view/Admin/Borrow.vue";
import BorrowReport from "../view/Admin/BorrowReport.vue";
import Notice from "../view/Admin/Notice.vue";
import Return from "../view/Admin/Return.vue";
import ReturnReport from "../view/Admin/ReturnReport.vue";
import BookMessage from "../view/Admin/BookMessage.vue";
//超级管理员
import AdminManage from "../view/SupperAdmin/AdminManage.vue";
import BookManage from "../view/SupperAdmin/BookManage.vue";
import BookType from "../view/SupperAdmin/BookType.vue";
import BorrowManage from "../view/SupperAdmin/BorrowManage.vue";
import BorrowRule from "../view/SupperAdmin/BorrowRule.vue";
import BorrowSearch from "../view/SupperAdmin/BorrowSearch.vue";
import SIntelligent from "../view/SupperAdmin/Intelligent.vue";
import SystemManage from "../view/SupperAdmin/SystemManage.vue";
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      component: Userlogin,
    },
    {
      //超级管理员登陆
      path: "/Userlogin",
      name: "Userlogin",
      component: Userlogin,
    },
    {
      //超级管理员登陆
      path: "/Superadmin",
      name: "Superadmin",
      component: Superadmin,
    },
    {
      //管理员登录
      path: "/Adminlogin",
      name: "Adminlogin",
      component: Adminlogin,
    },
    {
      //用户登录
      path: "/Userlogin",
      name: "Userlogin",
      component: Userlogin,
    },
    {
      //管理员首页
      path: "/Adminhome",
      name: "Adminhome",
      component: Adminhome,
      children: [
        {
          //借阅图书
          path: "/ABorrow",
          name: "ABorrow",
          component: ABorrow,
        },
        {
          //借书报表
          path: "/BorrowReport",
          name: "BorrowReport",
          component: BorrowReport,
        },
        {
          //发布通知
          path: "/Notice",
          name: "Notice",
          component: Notice,
        },
        {
          //归还图书
          path: "/Return",
          name: "Return",
          component: Return,
        },
        {
          //还书报表
          path: "/ReturnReport",
          name: "ReturnReport",
          component: ReturnReport,
        },
        {
          //书籍详情
          path: "/BookMessage/:bookId",
          name: "BookMessage",
          component: BookMessage,
        },
      ],
    },
    {
      //用户首页
      path: "/UserHome",
      name: "UserHome",
      component: UserHome,
      children: [
        {
          //首页
          path: "/First",
          name: "First",
          component: First,
        },
        {
          //图书查询
          path: "/Search",
          name: "Search",
          component: Search,
        },
        {
          //读者规则
          path: "/Rule",
          name: "Rule",
          component: Rule,
        },
        // {
        //   //超级管理员首页
        //   path: "/SuperHome",
        //   name: "SuperHome",
        //   component: SuperHome,
        // },
        {
          //借阅信息
          path: "/Borrow",
          name: "Borrow",
          component: Borrow,
        },
        {
          //个人信息
          path: "/Message",
          name: "Message",
          component: Message,
        },
        {
          //公告
          path: "/News",
          name: "News",
          component: News,
        },
        {
          //违章信息
          path: "/Peccant",
          name: "Peccant",
          component: Peccant,
        },
        {
          //智能推荐
          path: "/Intelligent",
          name: "Intelligent",
          component: Intelligent,
        },
        {
          //读者留言
          path: "/Comment",
          name: "Comment",
          component: Comment,
        },
      ],
    },
    {
      //超级管理员首页
      path: "/SuperHome",
      name: "SuperHome",
      component: SuperHome,
      children: [
        {
          //管理员管理
          path: "/AdminManage",
          name: "AdminManage",
          component: AdminManage,
        },
        {
          //书籍类型
          path: "/BookManage",
          name: "BookManage",
          component: BookManage,
        },
        {
          //书籍类型
          path: "/BookType",
          name: "BookType",
          component: BookType,
        },
        {
          //借阅证管理
          path: "/BorrowManage",
          name: "BorrowManage",
          component: BorrowManage,
        },
        {
          //借阅规则管理
          path: "/BorrowRule",
          name: "BorrowRule",
          component: BorrowRule,
        },
        {
          //借阅信息查询
          path: "/BorrowSearch",
          name: "BorrowSearch",
          component: BorrowSearch,
        },
        {
          //智能分析
          path: "/SIntelligent",
          name: "SIntelligent",
          component: SIntelligent,
        },
        {
          //系统管理
          path: "/SystemManage",
          name: "SystemManage",
          component: SystemManage,
        },
      ],
    },
  ],
});
export default router;
